﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Index2.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
死者登记服务
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="HeadContent" runat="server">
    <script type="text/javascript">
        var id = 'DeadNO';
        var ctrlName = 'RegistrationInfo';
        function Crud2(id, ctrlName) {
            Crud.call(this, id, ctrlName);
            this.Create = function () {
                var url = '../' + ctrlName + '/Create?s=' + new Date().getMilliseconds();
                var retValue = window.showModalDialog(url, "创建", "dialogHeight:440px; dialogWidth:640px; status:0; scroll:0");
                if (retValue) {
                    $('#dg').datagrid('reload');
                }
            }
            this.Edit = function () {
                var row = $('#dg').datagrid('getSelected');
                if (!row) {
                    $.messager.alert('提示', '请选择一条记录进行编辑!', 'info');
                    return;
                 }
                
                var url = '../' + ctrlName + '/Edit?id='+row[id]+'&s=' + new Date().getMilliseconds();
                var retValue = window.showModalDialog(url, "编辑", "dialogHeight:440px; dialogWidth:640px; status:0; scroll:0");
                if (retValue) {
                    $('#dg').datagrid('reload');
                }
            }
        }
        var crud = new Crud2(id, ctrlName);
        $(function () {
            $('#dg').datagrid({
                title: '死者列表',
                iconCls: 'icon-save',
                url: '../' + ctrlName + '/List',
                sortName: id,
                sortOrder: 'asc',
                remoteSort: false,
                idField: id,
                frozenColumns: [[
	                { field: 'ck', checkbox: true },
	                { title: '编号', field: id, width: 80, sortable: true }
				]],
                columns: [[
                        { field: 'DeadName', title: '姓名', width: 100 },
                        { field: 'DeadIDCard', title: '身份证号', width: 100 },
                        { field: 'DeadSex', title: '性别', width: 100 },
                        { field: 'DeadAge', title: '年龄', width: 100 },
                        { field: 'FamilyName', title: '亲属姓名', width: 100 },
                        { field: 'FamilyPhone', title: '联系电话', width: 100 },
                        { field: 'FamilyRelationship', title: '与死者关系', width: 100 },
                        { field: 'DeadCity', title: '县(市)', width: 100 },
                        { field: 'BurialMode', title: '下葬方式', width: 100 }
                    ]],
                pagination: true,
                fitColumns: true,
                toolbar: toolbar
            });
        });         
    </script>
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
    <div id="dlg" class="easyui-dialog" closed="true" buttons="#dlg-buttons" 
			style="width:800px;height:480px;padding:10px 20px">
		<div class="ftitle">死者信息</div>
	</div>
</asp:Content>


